<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.jspsmart.upload.SmartUpload"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
            SmartUpload mySmartdownload = new SmartUpload();
            if(request.getParameter("file")!=null&&!request.getParameter("file").equals("")){
					String downfile="/resources/resources/"+request.getParameter("file");
					try{
				      			 response.reset();
					 			 out.clear();
					 			 out = pageContext.pushBody();
				     			 mySmartdownload.initialize(pageContext);
				     			 mySmartdownload.setContentDisposition(null);
				    			 mySmartdownload.downloadFile(downfile);
				    			 //response.sendRedirect("/bluemsun/pages/subpages/resources.jsp");
				    			 System.out.println("my");
		 			}catch(Exception e){
		 				e.printStackTrace();
		 				  %>
		 	  			  <script>
		 	  			  alert("文件下载失败：请检查选择的文件是否存在");
		 	  			  history.go(-1);
		 	  			  </script>
		 	  			  <%
				     	    }
		 			}else{
  			  %>
  			  <script>
  			  alert("当前无文件可下载");
  			  history.go(-1);
  			  </script>
  			  <%
  		  }
		 %>
</body>
</html>